<?php

/**
 * Activate actions.
 *
 * @package    webmonstr
 * @subpackage Activate
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 2692 2006-11-15 21:03:55Z fabien $
 */
class ActivateActions extends sfActions
{
  /**
   * Executes index action
   *
   */
  public function executeUser()
  {
   
  	if($this->getRequestParameter('code'))
  	{
  		$c= new Criteria();
  		$c->add(sfGuardUserPeer::SALT, $this->getRequestParameter('code'));
        $user=sfGuardUserPeer::doSelectOne($c);
        $user->setIsActive(1);
        $user->save();
        
  	    
        $this->getContext()->getUser()->signIn($user);
        $this->getUser ()->setFlash ( 'message', __('Вы успешно активировали свой аккаунт') );
        $this->redirect('@welcome');
  		
  	}
  	
  	
  }
}

